Hi, everyone
I write these codes as follows
string strSrcModPath = "/MyTestProj/ModuleA"
Module mSrc = read(strSrcModPath,false)
if(null mSrc)
print "The module couldn't be used"
else
print "It can be used"
I run these codes in two ways:
1.Open another module(just name it ModuleB) under "MyTestProj", click "Tools"->"Edit DXL", paste these codes, and the result is "It can be used"
2.Put these codes in a self-defined menu button, however, the result is "The module couldn't be used"
My aim is to let these codes run in self-defined menu, please give me some hints or tips, very much thanks and looking forward for your reply.
Sincerely, Aven
Aven_HIT - Mon May 31 22:53:51 EDT 2010 |
|
Re: Why the same code result in different results Mathias Mamsch - Tue Jun 01 02:19:45 EDT 2010
I see nothing unusual with this code. Can you describe exactly what you are doing, when you say "Put this code in a self-defined menu button"? You might be facing a simple mistake, like the menu generated from a different file (try inserting some print statements). Regards, Mathias
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
|
Re: Why the same code result in different results Aven_HIT - Tue Jun 01 11:34:22 EDT 2010 Mathias Mamsch - Tue Jun 01 02:19:45 EDT 2010
I see nothing unusual with this code. Can you describe exactly what you are doing, when you say "Put this code in a self-defined menu button"? You might be facing a simple mistake, like the menu generated from a different file (try inserting some print statements). Regards, Mathias
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
Hi, Mathias
There is nothing unusual with these codes, what I exactly to do is to create a self-defined button in ModuleB to realize gathering imformation from ModuleA, it seems tricky very much and it make me afused very much. Could you please try it and find some problems, many thanks to you.
Sincerely, Aven
|
|
Re: Why the same code result in different results llandale - Tue Jun 01 17:11:16 EDT 2010
Is "/MyTestProj" the actual name of your Project? Or is it perhaps a name of a folder, inside some other Project? If its a Project then the code should work, but if its a Folder it will only work when your context is correct.
What is a 'self defined menu button'; that's probably the issue here. You will need to elaborate on what exactly you are doing to create it.
|
|
Re: Why the same code result in different results Aven_HIT - Wed Jun 02 13:00:08 EDT 2010 llandale - Tue Jun 01 17:11:16 EDT 2010
Is "/MyTestProj" the actual name of your Project? Or is it perhaps a name of a folder, inside some other Project? If its a Project then the code should work, but if its a Folder it will only work when your context is correct.
What is a 'self defined menu button'; that's probably the issue here. You will need to elaborate on what exactly you are doing to create it.
Hi, Louie
MyTestProj is a actual name of my project, unfortunatelly, these codes couldn't work as I expected.
The "self-defined menu button" is a .dxl file that I created under $DOORSHOME/lib/dxl/addins/user/, you know that if I create a .dxl file under that folder with some specific format as dxl.help describes, there will be a new button I can use like a menu button.
Indeed, I just develop a basic function to realize my final aim, however, with these same codes, in the two ways described, I got the different result, please try it on your PC if you have some interest in it.
Looking forward for your reply and best wishes!
Sincerely, Aven
|
|
Re: Why the same code result in different results llandale - Wed Jun 02 14:04:40 EDT 2010 Aven_HIT - Wed Jun 02 13:00:08 EDT 2010
Hi, Louie
MyTestProj is a actual name of my project, unfortunatelly, these codes couldn't work as I expected.
The "self-defined menu button" is a .dxl file that I created under $DOORSHOME/lib/dxl/addins/user/, you know that if I create a .dxl file under that folder with some specific format as dxl.help describes, there will be a new button I can use like a menu button.
Indeed, I just develop a basic function to realize my final aim, however, with these same codes, in the two ways described, I got the different result, please try it on your PC if you have some interest in it.
Looking forward for your reply and best wishes!
Sincerely, Aven
This works for me, both in the User menu and when run via the DXL window.
// OpenArch.dxl
/*
*/
string NameMod = "/MyProject/MyModule"
Module mSrc = read(NameMod,true)
if(null mSrc) //-
then print "The module couldn't be used"
else print "It can be used"
You need the comment line and comment block in order for the reference to be seen in the Menu; maybe that's your problem and something else is actually running. As Malias said, add some print statements "Yes Its Me" to make sure you are running the right DXL.
|
|
Re: Why the same code result in different results Aven_HIT - Thu Jun 03 09:11:40 EDT 2010 llandale - Wed Jun 02 14:04:40 EDT 2010
This works for me, both in the User menu and when run via the DXL window.
// OpenArch.dxl
/*
*/
string NameMod = "/MyProject/MyModule"
Module mSrc = read(NameMod,true)
if(null mSrc) //-
then print "The module couldn't be used"
else print "It can be used"
You need the comment line and comment block in order for the reference to be seen in the Menu; maybe that's your problem and something else is actually running. As Malias said, add some print statements "Yes Its Me" to make sure you are running the right DXL.
Hi, Louie
I checked out the difference between your code and my code, the only difference is
Your code:
Module mSrc = read(NameMod,true)
My code:
Module mSrc = read(NameMod,false)
Althrough I doesn't believe it is the problem occurs, I'll try it tomorrow.
I'm already let the "menu button" dxl file displayed in the menu.
Sincerely, Aven
|
|